<template>
  <div class="team">
    <h2>2018-04-07 --  {{ $route.params.name }}</h2>
      <el-table :data="teamData" ref="multipleTable">
          <el-table-column type="selection" :span="1">
          </el-table-column>
          <el-table-column prop="c1" label="状态" :span="2">
          </el-table-column>
          <el-table-column prop="c2" label="比赛时间" :span="4">
          </el-table-column>
          <el-table-column prop="c4T1" label="主队" :span="2">
          </el-table-column>
          <el-table-column prop="c4R" label="比分" :span="4">
          </el-table-column>
          <el-table-column prop="c4T2" label="客队" :span="4">
          </el-table-column>
      </el-table>
  </div>
</template>
<script>
// import axios from 'axios'
// const TeamData = require('../../utils/DataHelper')
const apiURL = 'http://op.juhe.cn/onebox/football/league'
// const para = this.$route.params.name
const apiURLPara = encodeURI('?dtype=&league=' + '中超' + '&key=42f228ce6f78c1bdcac4eb3e7574336c')
const apiFB = apiURL + apiURLPara
// const apiURLLocal = 'http://localhost:28133/api/product'
const jsonp = require('jsonp')

export default {
  name: 'FootballTeam',
  data () {
    return {
      msg: 'Football',
      teamData: []
    }
  },
  created: function () {
    console.log(this.$route.params.name)

    jsonp(apiFB, null, (err, data) => {
      if (err) {
        console.error(err.message)
      } else {
        // console.log(apiFB)
        this.teamData = data.result.views.saicheng1
      }
    })
  }
}
</script>
<style scoped>
.team{
    height: 100%;
}
</style>
